import java.util.InputMismatchException;
import java.util.Scanner;
public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        int y = scanner.nextInt();
        scanner.close();
        while(x != 0) {
            int temp = y % x;
            y = x;
            x = temp;
        }
        System.out.println("最大公约数是: "+y);
    }
}
